package com.thrd.taiexhibition.presener;

import com.thrd.taiexhibition.bean.BeanStoryType;
import com.thrd.taiexhibition.callback.MvpCallback;
import com.thrd.taiexhibition.model.CityStoryModel;
import com.thrd.taiexhibition.view.CityStoryView;

import java.util.List;

/**
 * @author: ${唐杰}
 * @date: 2021/3/22
 */
public class CityStoryPresener {
    private CityStoryModel mCityStoryModel;
    private CityStoryView mCityStoryView;

    public CityStoryPresener(CityStoryView mCityStoryView){
        this.mCityStoryView=mCityStoryView;
        this.mCityStoryModel=new CityStoryModel();
    }


    public void getCityStorData(int id){
        mCityStoryModel.getCityStory(id + "", new MvpCallback<List<BeanStoryType>>() {
            @Override
            public void onSuccess(List<BeanStoryType> stringBeanStoryMap) {
                mCityStoryView.onSuccess(stringBeanStoryMap);
            }

            @Override
            public void onFailed(String e, int code) {
                mCityStoryView.onError(e,code);
            }
        });
    }


}
